import React from 'react';
import { useContext } from 'react';
import contextData from '../../store/toduContext';
export default function Child1() {
  const context = useContext(contextData);
  console.log(context);
  return (
    <div>
      <h3>Child1 子组件 {context.count}</h3>
      <ul>
        {context.list.map((item, index) => (
          <li key={index}>
            {item.title}-------{item.content}
          </li>
        ))}
      </ul>
      <button onClick={() => context.updateCount(10)}>修改数据</button>
    </div>
  );
}
